<template>
    <view class="elasticity" :style="{paddingTop: paddingHeight + 'px'}">
        <nav-bar backgroundColor="#fafcff"></nav-bar>
        <view class="k_card">
            <view class="k_t_bg">{{ leveArticle.title }}</view>
            <view class="k_content">
                <u-parse :content="leveArticle.content" :tagStyle="style"></u-parse>
            </view>
        </view>
    </view>
</template>

<script>
import {
    findMeasureArticle
} from '@/api/index.js'
export default {
    data () {
        return {
            paddingHeight: uni.getStorageSync('navbarHeight'),
            leve: '',
            params:{
                rerLevel:'',
                tag:'',
                label:'',
            },
            leveObj: {
                '1': '高燃脂状态',
                '2': '燃脂状态',
                '3': '中度燃脂状态',
                '4': '低燃脂状态',
                '5': '非燃脂状态',
            },
            leveArticle:{},
            style:{
                h1:'text-align:left;color:#333;margin-bottom:32rpx;',
                h2:'text-align:left;color:#333;margin-bottom:32rpx;',
                h3:'text-align:left;color:#333;margin-bottom:32rpx;',
                h4:'text-align:left;color:#333;margin-bottom:32rpx;',
                h5:'text-align:left;color:#333;margin-bottom:32rpx;',
                p:'text-align:left;',
                text:'text-align:left;',
                view:'text-align:left;',
                ul:'text-align:left;padding:0',
                li:'text-align:left;',
            }
        }
    },
    onLoad (OPTIONS) {
        this.params.rerLevel = OPTIONS.rerLevel
        this.params.tag = OPTIONS.tag
        this.params.label = OPTIONS.label
        this.findMeasureArticle()
    },
    onShareAppMessage() {
        return {
            title: this.leveArticle.title,
			path: `/pagesB/knowledge/leve?rerLevel=${this.params.rerLevel}&tag=${this.params.tag}&label=${this.params.label}`,
			imageUrl: this.leveArticle.coverPic
        }
    },
    onShareTimeline() {
        return {
            title: this.leveArticle.title,
			path: `/pagesB/knowledge/leve?rerLevel=${this.params.rerLevel}&tag=${this.params.tag}&label=${this.params.label}`,
			imageUrl: this.leveArticle.coverPic,
        }
    },
    methods:{
        findMeasureArticle(){
            findMeasureArticle(this.params).then((res)=>{
                this.leveArticle = res.data
            }).catch((err)=>{
                
            })
        }
    }
}
</script>

<style lang="scss">
page {
    background-color: #fafcff;
    min-height: 100%;
}
</style>
<style lang="scss" scoped>
.elasticity {
    padding: 0 48rpx 48rpx 48rpx;
}
.txt {
    text-indent: 1em;
}
.txt.blod {
    text-indent: 0;
}


.k_content{
    text-align: left;
    font-size: 32rpx;
    color: #666666;
    line-height: 54rpx;
    letter-spacing: 2rpx;
    h4{
        text-align: left;
    }
}
</style>